package com.mlnx.data.enums;

/**
 * Created by amanda.shan on 2019/8/21.
 */
public enum OblCodeEnum {
    SUCCESS(0, "上传数据成功"), USER_EMPTY(1, "用户编号不能为空"),
    SBP_EMPTY(2, "高压值不能为空"), DBP_EMPTY(3, "低压值不能为空"),
    HEART_EMPTY(4, "心跳值不能为空"), NOT_HEART(5, "心律情况未给出"),
    TIME_EMPTY(6, "测量时间不能为空"), IMEI_EMPTY(7, "设备IMEI码不能为空");

    private Integer code;

    private String msg;

    OblCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMsg(Integer code){

        for (OblCodeEnum orbCodeEnum: OblCodeEnum.values()){
            if (orbCodeEnum.getCode().equals(code)){
                return orbCodeEnum.getMsg();
            }
        }

        return "";
    }
}
